package flexUnitTests
{
	import de.slowpoke.flattr.Flattr;
	
	import flexunit.framework.Assert;
	
	import org.flexunit.asserts.assertEquals;
	import org.flexunit.asserts.assertNotNull;
	
	public class TestFlattr
	{	
		
		public var flattr:Flattr;
		
		[Before]
		public function setUp():void
		{
		}
		
		[After]
		public function tearDown():void
		{
		}
		
		[BeforeClass]
		public static function setUpBeforeClass():void
		{
		}
		
		[AfterClass]
		public static function tearDownAfterClass():void
		{
		}
		
		[Test]
		public function testFlattr():void
		{
			this.flattr = new Flattr(123);
			assertNotNull(this.flattr);
		}
		
		[Test(expects="de.slowpoke.flattr.Error.FlattrError")]
		public function testFlattrNegativeUID():void
		{
			this.flattr = new Flattr(-22);
		}
		
		[Test(expects="de.slowpoke.flattr.Error.FlattrError")]
		public function testFlattrNaNUID():void
		{
			this.flattr = new Flattr(null);
		}
		
		[Test]
		public function testGet_uid():void
		{
			var uid:Number = 124;
			this.flattr = new Flattr(uid);
			assertEquals(uid, this.flattr.uid);
		}
	}
}